<?php
/**
 * Created by PhpStorm.
 * UserModel: Administrator
 * Date: 2019/3/01/0001
 * Time: 16:57
 */
namespace app\caidongweb\model;
/**
 * Class AuthRule
 * 导航权限
 * @package app\caidongweb\model
 */
class AuthRule extends BaseModel
{
    protected $table = 'cd_auth_rule';

    /**
     * function getList
     * 获取导航栏列表
     *
     * @return object
     */
    public function getList()
    {
        $list = $this->where('pid',0)->select();
        foreach($list as $key=>$val){
            $child_list = $this->where('pid',$val['id'])->select();
            $list[$key]['child'] = $child_list;
        }
        return $list;
    }
}